﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kocic.RepositoryManagement.Crm4;
//using SampleXrm.Xrm;

namespace Sample.Run.Crm4
{
//    public class ContactRepositoryManager : XrmRepositoryManager<contact, SampleXrmDataContext>
//    {
//        public override contact RetrieveSingle(object searchValue)
//        {
//            if (searchValue is Guid)
//            {
//                Guid contactId = (Guid)searchValue;

//                var results = from i in this.DataSource.contacts
//                              where i.contactid == contactId
//                              select i;

//                return results.SingleOrDefault();
//            }
//            else
//            {
//                throw new ArgumentException("searchValue must be of type Guid", "searchValue");
//            }
//        }

//        public override IEnumerable<contact> RetrieveMultiple()
//        {
//            throw new NotImplementedException();
//        }

//        public override IEnumerable<contact> RetrieveMultiple(object searchValue)
//        {
//            throw new NotImplementedException();
//        }

//        public contact RetrieveByName(String firstName, string lastName)
//        {
//            return this.DataSource.contacts.Where(c => c.firstname == firstName && c.lastname == lastName).SingleOrDefault();
//        }
//    }
}
